package com.ming.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ming.domain.SysPermission;
import com.ming.query.SysPermissionQuery;
import com.ming.vo.SysPermissionVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *@Author:何元才
 *@Desc:
 *@data:2021-04-09 23:15
 */
public interface SysPermissionMapper extends BaseMapper<SysPermission> {


    List<SysPermissionVO> queryUserPermission(Integer id);

    /**
     * 查询所有权限
     * @return
     */
    List<SysPermissionVO> selectAll();

    List<SysPermissionVO> selectList(SysPermissionQuery query);

    //权限一旦删除，角色权限关系也要删除
    void deleteRelByPermissionId(Integer id);

    //先查询子权限
    List<Integer> selectAllByParentId(@Param("parentId") List<Integer> ids);

    //删除
    void deleteById(@Param("ids") List<Integer> ids);
}